const mongoose = require("mongoose")
const schema = new mongoose.Schema(
  {
    author: { type: mongoose.Types.ObjectId, ref: "User", required: true },
    title: { type: String, required: true, maxlength: 30 },
    type: [{ type: mongoose.Types.ObjectId, ref: "Category" }],
    desc: String,
    uploadAt: { type: Number },
    imgUrl: { type: String, required: true },
    videoUrl: { type: String, required: true },
    playCount: { type: Number, default: 0 },
    collectList: [{ type: mongoose.SchemaTypes.ObjectId }],
    zanList: [{ type: mongoose.SchemaTypes.ObjectId }],
    audit: { type: Boolean, default: false },
  },
  {
    timestamps: true,
  }
)
module.exports = mongoose.model("Video", schema)
